<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<script>
	var ctx = "${ctx}";
</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>新发现供应管理</title>
<meta name="keywords"
	content="">
<meta name="description"
	content="">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, 26 Feb 209908:21:57 GMT">

	<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/font-awesome.min.css?v=4.4.0?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/animate.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/style.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/common.css?v=${static_version}" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css" rel="stylesheet">
	<!-- Data Tables -->
	<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css?v=${static_version}" rel="stylesheet" />
</head>

<body class="gray-bg">

	<div class="wrapper wrapper-content  animated fadeInRight">
			<div class="ibox float-e-margins">
			
			 <div class="ibox-title">
                    <h5>新发现供应管理<small></small></h5>
                </div>			
				<div class="ibox-content">
					<div class="row  m-b-xs">
					<form class="form-group" id="member_table_form">
						<div class="col-md-3">
							<div class="input-group">
								<span class="input-group-addon">供应分类：</span>
								<select name="cateId"
									class="form-control">
										<option value="-1">----</option>
										<c:forEach items="${cates}" var="cate">
											<option value="${cate.id}"
												<c:if test="${cate.id==conditions.cate_id}">selected</c:if>>${cate.cate_name}</option>
										</c:forEach>
								</select>
							</div>
						</div>
						<div class="col-md-2 col-sm-2">
							<div class="input-group">
								<span class="input-group-addon">供应名称：</span> <input
									id="activity_name" type="text" class="input-md form-control"
									placeholder="服务名称" name="activity_name">
							</div>
						</div>
						<div class="col-md-2 col-sm-2">
							<div class="input-group">
								<span class="input-group-addon">状态：</span> 
								<select name="status"
									class="form-control">
										<option value="-1">----</option>
										<option value="1"
											<c:if test="${1==conditions.status}">selected</c:if>>待审核</option>
										<option value="2"
											<c:if test="${2==conditions.status}">selected</c:if>>已审核</option>
										<option value="3"
											<c:if test="${3==conditions.status}">selected</c:if>>已驳回</option>
										<option value="4"
											<c:if test="${4==conditions.status}">selected</c:if>>已开始</option>
										<option value="5"
											<c:if test="${5==conditions.status}">selected</c:if>>已结束</option>
										<option value="6"
											<c:if test="${6==conditions.status}">selected</c:if>>已取消</option>
								</select>
							</div>
						</div>
						<div class="col-md-1 col-sm-1">
							<button name="" id=""   class="btn btn-primary radius" type="submit">
								 搜索
							</button>
						</div>
					</form>
					</div>
					
				    <div class="hr-line-dashed3"></div>
					<table data-action="" data-datatable="true"  class="table table-striped table-bordered table-hover dataTables-example">
				<thead>
					<tr >
                            <th  class="text-center" >供应名称</th>
                            
                            <th  class="text-center" >供应分类</th>
                            
                            <th  class="text-center" >发布时间</th>
                            
                            <th  class="text-center" >人数限制</th>
                            
                            <th  class="text-center" >开始时间</th>
                            
                            <th  class="text-center" >结束时间</th>
                            
                            <th  class="text-center" >状态</th>
                            
                            <th  class="text-center" >操作</th>
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${u_discovers}" var="u_discover">
						
						<tr class="text-c">
							<input type="hidden" id="id" name="id"
								value='${u_discover.id}' />
                                <td  class="text-center" >${u_discover.title}</td>
                                
                                <td  class="text-center" >${u_discover.cate_name}</td>
                                
                                <td  class="text-center" >${u_discover.add_time}</td>
                                
                                <td  class="text-center" >${u_discover.people_limit}</td>
                                
                                <td  class="text-center" >${u_discover.begin_time}</td>
                                
                                <td  class="text-center" >${u_discover.end_time}</td>
                                
                                <td  class="text-center" ><c:if test="${u_discover.status==1}">
                                	待审核
                                </c:if>
                                <c:if test="${u_discover.status==2}">
                                	已审核
                                </c:if>
                                <c:if test="${u_discover.status==3}">
                                	已驳回
                                </c:if>
                                <c:if test="${u_discover.status==4}">
                                	已开始
                                </c:if>
                                <c:if test="${u_discover.status==5}">
                                	已结束
                                </c:if>
                                <c:if test="${u_discover.status==6}">
                                	已驳回
                                </c:if></td>

							<td class="td-manage">
								<c:if test="${u_discover.status==1 || u_discover.status==2}">
                                	<a class="btn btn-primary"
									onClick="u_discover_edit(this,'${u_discover.id}')" href="javascript:void(0);"
									title="编辑">编辑</a>
                                </c:if>
								
								&nbsp;&nbsp;&nbsp;&nbsp;
								<c:if test="${u_discover.status==1}">
									<a class="btn btn-primary"
									onClick="u_discover_verify(this,'${u_discover.id}')" href="javascript:void(0);"
									title="审核">删除 </a>
								</c:if>
								<c:if test="${u_discover.status==2}">
									<a class="btn btn-primary"
									onClick="u_discover_verify(this,'${u_discover.id}')" href="javascript:void(0);"
									title="审核">取消 </a>
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
					</div>
					<div class="row">
						<div class="col-md-6" class="pull-left" id="page_left_text"></div>
						<div class="col-md-6" id="page_text"></div>
					</div>
				</div>
			</div>
		</div>
	</div>

	
	<script src="${ctx}/static/js/jquery.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/bootstrap.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/layer/layer.js?v=${static_version}"></script>
		<script
		src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js?v=${static_version}"></script>
	<script
		src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js?v=${static_version}"></script>
	<script type="text/javascript">
	
	
	$(document).ready(function() {
		$(".dataTables-example").dataTable();
	});
	
       /*编辑  */
	    $(function() {
			$('.table-sort').dataTable({
				"aaSorting" : [ [ 0, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 1, 2 ]
				} // 制定列不参与排序
				]
			});
			$('.table-sort tbody').on('click', 'tr', function() {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				} else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
		});  
		
		/*编辑*/
		function u_discover_edit(obj,id,w,h){
/* 			var edit_page = "${ctx}/create-service-discover?id="+id;
			layer_show("编辑",edit_page,w,h); */			
			var edit_page = "${ctx}/create-service-discover?id="+id;
			var index = layer.open({
				type: 2,
				title: "编辑",
				content: edit_page
			});
			layer.full(index);
		}

		function u_discover_verify(obj, id,w,h) {
		
			var verify_page = "${ctx}/backstage/u_activity_discover-verify?id="+id;
			var index = layer.open({
				type: 2,
				title: "审核",
				content: verify_page
			});
			layer.full(index);
		}  
		
	</script>
</body>

</html>